<template>
  <div class="dashboard-container">
    <el-page-header content="公告" title="刷新" @back="getData" />
    <el-divider />

    <el-collapse>
      <el-collapse-item v-for="(e,i) in list" :title="'标题：'+e.title" :name="i">
        <p>内容 </p>
        <p>{{ e.content }}</p>
        <p>发布于：{{ e.createTime }}</p>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { getListComm, IMAGE_API } from '@/api/comm'
export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  data() {
    return {
      module: 'announcement',
      list: null,
      listLoading: true
    }
  },
  created() {
    this.getData()
  },
  methods: {
    getData() {
      this.listLoading = true
      getListComm(this.module, null).then(response => {
        this.list = response.data
        this.listLoading = false
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }

  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}

</style>
